<meta charset="utf-8">
<style>

    div{
     
           background: pink;
    
           font-size:200px;

           color:red;

           text-align:center;
    }
</style>
<div id="z1"></div>
<script>
    var i=10;
    var t=setInterval(f,1000);


    function f(){
 
      if(i>0)  {   
          z1.innerHTML = i;}
      else{
             z1.innerHTML = "时间到";
             clearInterval(t);

         }
         i--;
     }
 
</script>